#include "comm/my_cleanup.h"
#include "comm/my_log.h"
#include "comm/my_mem.h"

void my_test(void *data)
{
    MY_LOG_DEBUG("cleanup %d", (intptr_t)data);
}

int main()
{
    my_cleanup_handler_add(&g_cleanup_list, my_test, (void *)1);
    my_cleanup_handler_add(&g_cleanup_list, my_test, (void *)2);
    my_cleanup_handler_add(&g_cleanup_list, my_test, (void *)3);
    my_cleanup_handler_add(&g_cleanup_list, my_test, (void *)4);
    my_cleanup_handler_add(&g_cleanup_list, my_test, (void *)5);
    my_cleanup_list_exec(&g_cleanup_list);

    my_mem_assert_leak();

    MY_LOG_DEBUG("test pass");
}